/* Ejercicio 3.39
   ejer3_39.c */
#include <stdio.h>

/* funcion main, el programa inicia aca */
int main( void )
{
    int v, a, counter;

    printf( "Enter a number: " );
    scanf( "%d", &v );

    a = v;
    counter = 0;

    while ( a != 0 ) {
        if ( a % 10 == 7 ) {
            ++counter;
        }
        a /= 10;
    }

    printf( "The number %d has %d 7's\n", v, counter );

	return 0;
} /* fin de la funcion main */
